﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XKJ.OAWeb.Models;
using XKJ.OAWeb.Shared;

namespace XKJ.OAWeb.Infrastructrue
{
    public interface IBaseRepository<T> where T:class
    {
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        IQueryable<T> Show();
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Add(T entity);
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        T Backfill(int Id);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Uptdate(T entity);
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        bool Delete(T entity);
        /// <summary>
        /// 删除Id
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        bool DeleteId(int Id);
    }
}
